﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DuyetHoSoGhiDanh.aspx.cs" Inherits="DangKyOnline.DuyetHoSoGhiDanh" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Duyệt danh sách ghi danh đăng ký</title>
    <script language="javascript" type="text/javascript">
        
        function ChangeGridRowColor(element) {
            if (element.style.backgroundColor == 'yellow')
                element.style.backgroundColor = 'DEDFDE';
            else
                element.style.backgroundColor = 'yellow';
        }

        function ToggleRowColor(element) {
            if (element.style.backgroundColor == 'cyan') {
                element.style.backgroundColor = '#DEDFDE';
                element.style.cursor = 'hand';
                element.style.textDecoration = 'none';
            }
            else {
                element.style.backgroundColor = 'cyan';
                element.style.cursor = 'hand';
                element.style.textDecoration = 'underline';
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:Panel ID="Panel1" runat="server" GroupingText="Lọc danh sách" 
            Font-Bold="False">
            <asp:Label ID="Label1" runat="server" Text="Khoá học"></asp:Label>
            <asp:DropDownList ID="ddlKhoaHoc" runat="server">
            </asp:DropDownList>
            &nbsp;&nbsp;
            <asp:Label ID="Label2" runat="server" Text="Hạng xe"></asp:Label>
            <asp:DropDownList ID="ddlHangXe" runat="server">
            </asp:DropDownList>
            <asp:Button ID="btnSearch" runat="server" onclick="btnSearch_Click" 
                Text="Lọc thông tin" />
       </asp:Panel>
       <br />
       <asp:Panel ID="Panel2" runat="server" GroupingText="Thông tin ghi danh đăng ký">
        <asp:GridView ID="gvPhieuGhiDanh" runat="server" 
            EnableModelValidation="True" 
            AutoGenerateColumns="False" CellPadding="3" AllowPaging="True" 
               BackColor="White" BorderColor="White" BorderStyle="Ridge" 
               BorderWidth="2px" AllowSorting="True" CaptionAlign="Top" CellSpacing="1" 
               EmptyDataText="Hiện tại không có dữ liệu nào" 
               onrowdatabound="gvPhieuGhiDanh_RowDataBound" GridLines="None">
            <Columns>
                <asp:CommandField ButtonType="Button" ShowSelectButton="True" />
                <asp:BoundField DataField="Khoa" Visible ="False" ShowHeader="False" />
                <asp:BoundField DataField="TenDoiTuong" HeaderText="Họ tên" />
                <asp:BoundField DataField="NgaySinh" DataFormatString="{0:d}" 
                    HeaderText="Ngày sinh" />
                <asp:BoundField DataField="CMND" HeaderText="CMND" />
                <asp:BoundField DataField="DiaChiThuongTru" HeaderText="Địa chỉ thường trú" />
                <asp:BoundField DataField="MaKhoaHoc" HeaderText="Mã khoá học" />
                <asp:BoundField DataField="MaHangXe" HeaderText="Mã hạng xe" />
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label runat="server" Text="Gửi mail đăng ký" ID="Label4"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label runat="server" 
                            Text='<%#ChangeTrangThaiGuiMail((int)DataBinder.Eval(Container.DataItem, "TrangThaiGuiMailDangKy"))%>' 
                            ID="Label3"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                   <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label runat="server" Text="Trạng thái"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Label runat="server" 
                            Text='<%#ChangeTrangThaiGhiDanh((int)DataBinder.Eval(Container.DataItem, "TrangThaiPhieuGhiDanh"))%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                 <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label runat="server" Text="Xem chi tiết" ID="Label4"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink id="hplViewDetail" Text="Xem chi tiết" NavigateUrl='#' Visible="True" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
            <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
            <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
            <RowStyle ForeColor="Black" BackColor="#DEDFDE" />
            <SelectedRowStyle BackColor="cyan"/>
        </asp:GridView>
        <asp:Literal ID="ltMessage" runat="server"></asp:Literal>
    </asp:Panel>
     <br />
     <asp:Panel ID="Panel3" runat="server">
         <asp:Button ID="btnDuyet" runat="server" Text="Duyệt phiếu ghi danh" 
                   ToolTip="Duyệt phiếu ghi danh được chọn trên lưới" Visible="False" />
         <asp:Button ID="btnTroVe" runat="server" Text="Trở về" />
     </asp:Panel>
    </div>
 
    </form>
</body>
</html>
